#include <iostream>
using namespace std;

template <typename T> void swap2num(T* a, T* b);
template <class T> T get_max(T &a, T &b, T &c);

template <typename T1, typename T2>
class Point {
	public:
		Point(T1 x, T2 y) : m_x(x), m_y(y) { }
		void show();

	private:
		T1 m_x;
		T2 m_y;
};

template <typename T1, typename T2>
void Point<T1, T2>::show()
{
	cout << "x: " << m_x << ", y: " << m_y << endl;
}

int main(void)
{
	int a = 7, b = 2;
	float c = 3.1, d = 4.2, e = 5.6;
	Point p1(5.1, 2.2);
	Point p2("34°59'20\"N", "106°36'52\"W");

	cout << a << ' ' << b << endl;
	cout << c << ' ' << d << endl;

	swap2num(&a, &b);
	swap2num(&c, &d);

	cout << a << ' ' << b << endl;
	cout << c << ' ' << d << endl;

	cout << get_max(c, d, e) << endl;

	p1.show();
	p2.show();

	return 0;
}

template <typename T>
void swap2num(T* a, T* b)
{
	T t;

	t = *a;
	*a = *b;
	*b = t;
}

template <class T>
T get_max(T &a, T &b, T &c)
{
	T ab = a > b ? a : b;

	return ab > c ? ab : c;
}

